package com.from.menlo.park.data;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Photo {
	private  byte[] data;
    private Bitmap photo;
    private long id;
    private long entryId;
    public long getEntryId() {
		return entryId;
	}
	public void setEntryId(long entryId) {
		this.entryId = entryId;
	}
	public Photo(long id, byte[] data, Bitmap photo, long entryId){
    	this.id = id;
    	this.data = data;
    	this.photo = photo;
    	this.entryId = entryId;
    }
	public byte[] getData() {
		return data;
	}
	public void setData(byte[] data) {
		this.data = data;
	}
	public Bitmap getPhoto() {
		if ( photo == null && data != null ){
			photo = BitmapFactory.decodeByteArray(data, 0, data.length);
		}
		return photo;
	}
	public void setPhoto(Bitmap photo) {
		this.photo = photo;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
}
